﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace GameLib1
{
    class Container<T> 
    {
        int mSize = 0 ;
        public List<T> mData = new List<T>(); 

        public Container()
        {
        }

        public void Add(T item)
        {
            mSize++;
            mData.Add(item);
        }

        public T this[ int index ]
        {
            get
            {
                return mData[index];
            }
            set
            {
                mData[index] = value;
            }
        }   

        public void Remove(T item)
        {
            mData.Remove(item);
            mSize--;
        }

        public void Clear()
        {
            mSize = 0;
            mData.Clear();
        }

        public T Last()
        {
            return mData[(mSize - 1)];
        }
    }
}
